package com.heimo.agentlicence.htmlchecker;

import java.util.regex.Matcher;
import java.util.regex.Pattern;



public class DisciplineResultChecker extends BasicChecker {
	private final String TAG = "DisciplineResultChecker";

	public boolean fnGetAgentModelFromHtml(String result)
			throws Exception {
		super.hasError(result);
		return fnGetRecordFromHtml(result);
	}

	public boolean fnGetRecordFromHtml(String html) {
		boolean hasRecord = true;
		Pattern pattern = Pattern.compile("沒有找到相關的紀錄");
		Matcher matcher = pattern.matcher(html);
	    // Check all occurance
	    while (matcher.find()) {
	    	return !hasRecord;
	    }
		return hasRecord;
		
		
//		boolean hasEmptyRecordPattern  = html.contains("沒有找到相關的紀錄 ");
//		System.out.println("hasEmptyRecordPattern :"+hasEmptyRecordPattern);
//		return !hasEmptyRecordPattern;
	}

}
